<?php
$query = dibi::fetch("SELECT * FROM `users` WHERE id =%i",$_GET['u']);
$md5_db = md5($query['mail']);
if($query['activated'] == 1)
{
 echo $lang['reg_already_activated'];
}
else
{
	if($md5_db == $_GET['hash'])
	{
	 dibi::query("UPDATE `users` SET `activated` = 1 WHERE `id` = %i",$_GET['u']);
	 echo $lang['reg_activated'];
	}
	else
	{
	 echo $lang['reg_activate_error'];
	}
}
?>